package com.veryedu.hibernate.biz.bean;

public class SeatBean implements Comparable<SeatBean>{
	private Integer seatId;
	private String seatName;
	private Integer rowno;
	private Integer colno;
	private boolean isSold;
	public Integer getSeatId() {
		return seatId;
	}
	public void setSeatId(Integer seatId) {
		this.seatId = seatId;
	}
	public String getSeatName() {
		return seatName;
	}
	public void setSeatName(String seatName) {
		this.seatName = seatName;
	}	
	public Integer getRowno() {
		return rowno;
	}
	public void setRowno(Integer rowno) {
		this.rowno = rowno;
	}
	public Integer getColno() {
		return colno;
	}
	public void setColno(Integer colno) {
		this.colno = colno;
	}
	public boolean getIsSold() {
		return isSold;
	}
	public void setIsSold(boolean isSold) {
		this.isSold = isSold;
	}
	@Override
	public int compareTo(SeatBean o) {
		if(this.rowno.compareTo(o.getRowno()) < 0 ) return -1;
		else if(this.rowno.compareTo(o.getRowno()) == 0){
			if(this.colno.compareTo(o.getColno()) < 0) return -1;
			else if(this.colno.compareTo(o.getColno()) > 0) return 1;
			else return 0;
		}
		else return 1;
	}
}
